def answer_1():
    n = int(input("请输入数值数字个数n="))
    b = int(input("请输入计算数值b="))

    sum = 0
    for i in range(n):
        sum += (n - i) * b * 10 ** i

    print("计算和为：", sum)


def answer_2():
    n = int(input("请输入数值数字个数n="))
    a = int(input("请输入计算数值b="))

    Tn = 0
    Sn = []
    total1 = 0
    for count in range(n):
        Tn = Tn + a
        a = a * 10
        Sn.append(Tn)
    for i in Sn:
        total1 += i
    print("计算和为：", total1)


answer_1()
# answer_2()
